package messages
import (
"fmt"
"time"
"github.com/jcmturner/gofork/encoding/asn1"
"github.com/jcmturner/gokrb5/v8/iana/asnAppTag"
"github.com/jcmturner/gokrb5/v8/iana/msgtype"
"github.com/jcmturner/gokrb5/v8/krberror"
"github.com/jcmturner/gokrb5/v8/types"
)
type APRep struct {
PVNO int `asn1:"explicit,tag:0"`
MsgType int `asn1:"explicit,tag:1"`
EncPart types .EncryptedData `asn1:"explicit,tag:2"`
}
type EncAPRepPart struct {
CTime time .Time `asn1:"generalized,explicit,tag:0"`
Cusec int `asn1:"explicit,tag:1"`
Subkey types .EncryptionKey `asn1:"optional,explicit,tag:2"`
SequenceNumber int64 `asn1:"optional,explicit,tag:3"`
}
func (a *APRep ) Unmarshal (b []byte ) error {
_ , err := asn1 .UnmarshalWithParams (b , a , fmt .Sprintf ("application,explicit,tag:%v" , asnAppTag .APREP ))
if err != nil {
return processUnmarshalReplyError (b , err )
}
expectedMsgType := msgtype .KRB_AP_REP
if a .MsgType != expectedMsgType {
return krberror .NewErrorf (krberror .KRBMsgError , "message ID does not indicate a KRB_AP_REP. Expected: %v; Actual: %v" , expectedMsgType , a .MsgType )
}
return nil
}
func (a *EncAPRepPart ) Unmarshal (b []byte ) error {
_ , err := asn1 .UnmarshalWithParams (b , a , fmt .Sprintf ("application,explicit,tag:%v" , asnAppTag .EncAPRepPart ))
if err != nil {
return krberror .Errorf (err , krberror .EncodingError , "AP_REP unmarshal error" )
}
return nil
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .